package com.zqwm.fly.mongo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@SuppressWarnings("all")
@Repository
public class PriceConfigMongodb extends Mongodb<String>
{
    private static final Logger logger = LoggerFactory.getLogger(PriceConfigMongodb.class);

    //获取价格
    public String getPriceConfig(String cityCod,String carType)
    {
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("city_code",cityCod);
        map.put("car_type_id",carType);

        return findOneByItems(map,"price_config");
    }

    //获取价格
    public List<String> getPriceConfig(String cityCod)
    {
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("city_code",cityCod);

        return findByItems(map,"price_config");
    }

    //设置价格配置
    public boolean setPriceConfig(String priceConfig)
    {
        insert(priceConfig);
        return true;
    }
}
